<template>
  <div class="box_1">
    <bigscreen-header :headerName="'巴林右旗大板镇' + `${villageName}`+ '牧业统计'" />

    <div class="w_full h_full-70 flex_row_between">
      <!-- 1 -->
      <div class="w_32_p h_full flex_column_between">
        <div class="flex_1 p_5">
          <div class="full border_radius_10 chart_box_bgi">
            <div class="chart_title l_30 lh_30 text_center"><span @click="goToPage('/')">牲畜存栏</span></div>
            <bing-tu :value="data1" />
          </div>
        </div>

        <div class="flex_1 p_5">
          <div class="full border_radius_10 chart_box_bgi">
            <div class="chart_title l_30 lh_30 text_center"><span @click="goToPage('/')">防疫统计</span></div>
            <kong-xin-bing-tu :value="data2" />
          </div>
        </div>
      </div> 

      <!-- 2 -->
      <div class="w_32_p h_full flex_column_between">
        <div class="w_full h_49_p">
          <div class="w_full h_80_p relative">
            <hao-rao-qin v-if="villageName == '浩饶沁嘎查'" />
            <tai-bu-dai v-if="villageName == '太布呆嘎查'" />
            <da-leng v-if="villageName == '大冷村'" />
            <gu-li-gu-tai v-if="villageName == '古力古台嘎查'"/>
            <hong-qi v-if="villageName == '乌兰图嘎嘎查'" />
            <ji-bu-tu v-if="villageName == '吉布吐嘎查'" />
            <xi-ha v-if="villageName == '西哈嘎查'" />
            <xi-ha v-if="villageName == '巴润哈日毛都嘎查村委员会'" />
            <wen-gen-tu v-if="villageName == '温根吐嘎查'" />
            <shi-jia-zi v-if="villageName == '阿日班格日嘎查'"/>
            <su-ai-li v-if="villageName == '苏艾力嘎查'" />
            <zhao-hu-du-ge v-if="villageName == '昭胡都格嘎查'" />
            <weng-gen-mao-du v-if="villageName == '翁根毛都嘎查'" />
            <tao-bai-cun v-if="villageName == '套白村'" />
            <gui-le-su-tai v-if="villageName == '归勒斯台嘎查'" />
            <!-- <div class="absolute_center main_color" v-else>暂无地区图片</div> -->
          </div>

          <div class="w_full h_20_p color_fff">
            全嘎查总土地面积 104 平方公里，
            其中：草木场面积 2.5万亩，耕地面积4.5万亩，林地面积3,4万亩，
            棚圈： 1400平米，饲草料加工设备：189台，青储窑：2100平米。
          </div>
        </div>
        
        <div class="w_full h_49_p border_radius_10 chart_box_bgi" >
          <div class="chart_title l_30 lh_30 text_center cursor"><span>繁殖统计</span></div>
          <div class="w_full h_full-30">
            <zhu-zhuang-tu class="chart" :value="data3" />
          </div>
        </div>
      </div> 

      <!-- 3 -->
      <div class="w_32_p h_full flex_column_between">
        <div class="full border_radius_10 chart_box_bgi">
          <div class="chart_title l_30 lh_30 text_center cursor"><span>牧户统计</span></div>
          <div class="w_full h_full-30 scroll_box overflow_y_auto">
            <div class="w_full h_30 flex_row_around ph_30 text_1">
              <div class="flex_1 text_center main_color">牧户</div> 
              <div class="flex_1 text_center main_color">电话</div> 
            </div>

            <div class="w_full h_full-30 scroll_box ovweflow_y_auto ph_30" >
              <div 
                class="w_full h_30 flex_row_around" 
                v-for="(item, index) in muHuList" :key="index"
              >
                <div class="flex_1 ellipsis color_fff cursor text_1" @click="goToMuHuPage(item)">{{ item.nickName }}</div> 

                <div class="flex_1 text_left">
                  <div class="font_number ls_2 main_color text_1"> {{ formatPhone(item.phone) }} </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div> 
    </div>
  </div>
</template>

<script>
  import BigscreenHeader from '@/common/header/index.vue';
  import { getMuHuList } from '../../../../config/api';

  import BaLinYouQiMap from '../maps/baLinYouQiMap.vue';
  import BingTu from '../charts/bing-tu.vue'
  import ZhuZhuangTu from '../charts/zhu-zhuang-tu.vue';
  import kongXinBingTu from '../charts/kong-xin-bing-tu.vue';
  
  import HaoRaoQin from '../maps/da-ban-hamlet/hao-rao-qin.vue';
  import TaiBuDai from '../maps/da-ban-hamlet/tai-bu-dai.vue';
  import DaLeng from '../maps/da-ban-hamlet/da-leng.vue';
  import GuLiGuTai from '../maps/da-ban-hamlet/gu-li-gu-tai.vue';
  import HongQi from '../maps/da-ban-hamlet/hong-qi.vue';
  import JiBuTu from '../maps/da-ban-hamlet/ji-bu-tu.vue';
  import WenGenTu from '../maps/da-ban-hamlet/wen-gen-tu.vue';
  import XiHa from '../maps/da-ban-hamlet/xi-ha.vue';
  import ShiJiaZi from '../maps/da-ban-hamlet/shi-jia-zi.vue';
  import SuAiLi from '../maps/da-ban-hamlet/su-ai-li.vue';
  import ZhaoHuDuGe from '../maps/da-ban-hamlet/zhao-hu-du-ge.vue';
  import WengGenMaoDu from '../maps/da-ban-hamlet/weng-gen-mao-du.vue';
  import TaoBaiCun from '../maps/da-ban-hamlet/tao-bai-cun.vue';
  import GuiLeSuTai from '../maps/da-ban-hamlet/gui-le-su-tai.vue';

  import { getUserList, getRecordsYiStatisticByAreaCode } from '@/config/api.js';

  export default {
    name: 'showPage1',
    components: {
      BigscreenHeader,
      BaLinYouQiMap,
      BingTu,
      ZhuZhuangTu,
      kongXinBingTu,
      HaoRaoQin,
      TaiBuDai,
      DaLeng,
      GuLiGuTai,
      HongQi,
      XiHa,
      WenGenTu,
      ShiJiaZi,
      SuAiLi,
      JiBuTu,
      ZhaoHuDuGe,  
      WengGenMaoDu,
      TaoBaiCun,
      GuiLeSuTai
    },
        
    data() {
      return {
        groupList: [],

        data1: {
          title: '养殖类',
          unit: '头、只',
          data: []
        },
        data2: {
          title: '防疫统计',
          unit: '头、只、匹',
          isShowUnit: true,
          data: []
        },
        data3: {
          title: '繁殖统计',
          unit: '头、只',
          data: []
        },

        muHuList: [],
        testMuHuList: [
          { name: '孟和那顺', cattle: '牛、羊' },
          { name: '杨景霞', cattle: '绵羊' },
          { name: '黄占柱', cattle: '绵羊、山羊' },
          { name: '黄波', cattle: '绵羊、山羊' },
          { name: '韩琢', cattle: '绵羊、山羊' },
          { name: '韩国勇', cattle: '绵羊、山羊' },
          { name: '李俊成', cattle: '绵羊、山羊' },
          { name: '薛文宝', cattle: '绵羊、山羊' },
          { name: '李长合', cattle: '绵、鹅' },
          { name: '尔灯孟和', cattle: '牛、绵羊' },
          { name: '徐金坦', cattle: '牛' },
          { name: '布和', cattle: '牛、绵羊、山羊' },
          { name: '斯钦毕力格', cattle: '牛、绵羊' },
          { name: '赛音吉雅', cattle: '牛、绵羊、山羊' },
          { name: '巴音吉日嘎拉', cattle: '牛、绵羊' },
          { name: '额尔灯格日乐', cattle: '牛、绵羊' },
          { name: '孟和乌力吉', cattle: '牛' },
          { name: '额尔德木图', cattle: '牛、绵羊' },
          { name: '斯钦召日格', cattle: '牛、绵羊' },
          { name: '胡日乐', cattle: '牛、绵羊' },
          { name: '温都苏', cattle: '牛、绵羊' },
          { name: '大、那顺达来', cattle: '牛、绵羊、山羊' },
          { name: '孟和达来', cattle: '牛、绵羊、山羊' },
          { name: '小、斯钦孟和', cattle: '牛、绵羊' },
          { name: '那顺宝音', cattle: '牛、绵羊、山羊' },
          { name: '阿木尔吉日嘎拉', cattle: '牛、绵羊、山羊' },
          { name: '斯钦图', cattle: '牛、绵羊、山羊' },
          { name: '巴图孟和', cattle: '牛、绵羊、山羊' },
          { name: '孟根高乐', cattle: '牛、绵羊、山羊' },
          { name: '薛文双', cattle: '牛、绵羊、山羊' },
        ],
        villageName: '',
      }
    },
    mounted() {
      let villageId = this.$route.params.villageId
      let villageName = this.$route.params.villageName

      this.villageId = villageId
      this.villageName = villageName
      
      // 获取 xxx 嘎查的 所有牧户
      this.getUserList(villageId)

      // 获取 xxx 嘎查的 防疫记录
      this.getRecordsYiStatisticByAreaCode(villageId, 4, 8)

      setTimeout(() => {
        this.initChart()
      }, 100)
    },
    methods: {
      // 初始化图表
      initChart() {
        if (this.villageName == '西哈嘎查' || this.villageName == '巴润哈日毛都嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 7460, "unit": ''},
            {"name": "山羊", "value": 2340, "unit": ''},
            {"name": "绵羊", "value": 4190, "unit": ''},
            {"name": "马", "value": 480, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''}
          ]
          this.data2.data = [
            {"name": "牛", "value": 3917, "unit": ''},
            {"name": "山羊", "value": 1790, "unit": ''},
            {"name": "绵羊", "value": 3841, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''}
          ]
        } else if (this.villageName == '阿日班格日嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 2920, "unit": ''},
            {"name": "山羊", "value": 1203, "unit": ''},
            {"name": "绵羊", "value": 3995, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "马", "value": 148, "unit": ''}
          ]
          this.data2.data = [
            {"name": "牛", "value": 1687, "unit": ''},
            {"name": "山羊", "value": 803, "unit": ''},
            {"name": "绵羊", "value": 2795, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''}
          ]
        } else if (this.villageName == '巴罕宝拉格村') {
          this.data1.data = [
            {"name": "牛", "value": 110, "unit": ''},
            {"name": "绵羊", "value": 2650, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '巴彦汗嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 2897, "unit": ''},
            {"name": "绵羊", "value": 7120, "unit": ''},
            {"name": "山羊", "value": 998, "unit": ''},
            {"name": "马", "value": 216, "unit": ''},
            {"name": "驴", "value": 9, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '宝拉格嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 5760, "unit": ''},
            {"name": "绵羊", "value": 10280, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 217, "unit": ''},
            {"name": "驴", "value": 2, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 6, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '查日斯台嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 2202, "unit": ''},
            {"name": "绵羊", "value": 3060, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 50, "unit": ''},
            {"name": "驴", "value": 2, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '都希嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 1343, "unit": ''},
            {"name": "绵羊", "value": 4049, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 0, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '归勒斯台嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 3263, "unit": ''},
            {"name": "绵羊", "value": 6044, "unit": ''},
            {"name": "山羊", "value": 344, "unit": ''},
            {"name": "马", "value": 350, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '浩饶钦嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 4876, "unit": ''},
            {"name": "绵羊", "value": 6481, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 143, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '和布特哈达嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 1305, "unit": ''},
            {"name": "绵羊", "value": 10828, "unit": ''},
            {"name": "山羊", "value": 166, "unit": ''},
            {"name": "马", "value": 60, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 164, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '红星村') {
          this.data1.data = [
            {"name": "牛", "value": 500, "unit": ''},
            {"name": "绵羊", "value": 5500, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 100, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '胡斯台嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 3586, "unit": ''},
            {"name": "绵羊", "value": 9563, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 134, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '胡特林高勒村') {
          this.data1.data = [
            {"name": "牛", "value": 183, "unit": ''},
            {"name": "绵羊", "value": 8020, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 8, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 68, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '吉布吐村') {
          this.data1.data = [
            {"name": "牛", "value": 86, "unit": ''},
            {"name": "绵羊", "value": 7174, "unit": ''},
            {"name": "山羊", "value": 110, "unit": ''},
            {"name": "马", "value": 5, "unit": ''},
            {"name": "驴", "value": 78, "unit": ''},
            {"name": "骡子", "value": 4, "unit": ''},
            {"name": "猪", "value": 160, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '莫日古其格村') {
          this.data1.data = [
            {"name": "牛", "value": 246, "unit": ''},
            {"name": "绵羊", "value": 4010, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 118, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 230, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '那日斯台嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 2905, "unit": ''},
            {"name": "绵羊", "value": 6483, "unit": ''},
            {"name": "山羊", "value": 301, "unit": ''},
            {"name": "马", "value": 268, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '前进村') {
          this.data1.data = [
            {"name": "牛", "value": 1280, "unit": ''},
            {"name": "绵羊", "value": 4520, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 25, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 200, "unit": ''},
            {"name": "骆驼", "value": 130, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '沙日沐沦嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 2783, "unit": ''},
            {"name": "绵羊", "value": 7165, "unit": ''},
            {"name": "山羊", "value": 674, "unit": ''},
            {"name": "马", "value": 731, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '苏艾勒嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 827, "unit": ''},
            {"name": "绵羊", "value": 1503, "unit": ''},
            {"name": "山羊", "value": 74, "unit": ''},
            {"name": "马", "value": 14, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 12, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '套白村') {
          this.data1.data = [
            {"name": "牛", "value": 50, "unit": ''},
            {"name": "绵羊", "value": 4568, "unit": ''},
            {"name": "山羊", "value": 520, "unit": ''},
            {"name": "马", "value": 130, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 20, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '翁根毛都嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 2763, "unit": ''},
            {"name": "绵羊", "value": 9298, "unit": ''},
            {"name": "山羊", "value": 115, "unit": ''},
            {"name": "马", "value": 102, "unit": ''},
            {"name": "驴", "value": 9, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '乌额根图嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 3980, "unit": ''},
            {"name": "绵羊", "value": 5092, "unit": ''},
            {"name": "山羊", "value": 90, "unit": ''},
            {"name": "马", "value": 135, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '乌兰图嘎嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 2420, "unit": ''},
            {"name": "绵羊", "value": 10658, "unit": ''},
            {"name": "山羊", "value": 835, "unit": ''},
            {"name": "马", "value": 288, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '新达冷村') {
          this.data1.data = [
            {"name": "牛", "value": 2295, "unit": ''},
            {"name": "绵羊", "value": 6546, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 58, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 53, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '新立村') {
          this.data1.data = [
            {"name": "牛", "value": 637, "unit": ''},
            {"name": "绵羊", "value": 1763, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 2, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 393, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '伊逊毛都嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 2140, "unit": ''},
            {"name": "绵羊", "value": 11530, "unit": ''},
            {"name": "山羊", "value": 926, "unit": ''},
            {"name": "马", "value": 39, "unit": ''},
            {"name": "驴", "value": 70, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '友爱村') {
          this.data1.data = [
            {"name": "牛", "value": 897, "unit": ''},
            {"name": "绵羊", "value": 3097, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 121, "unit": ''},
            {"name": "驴", "value": 36, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 82, "unit": ''},
            {"name": "骆驼", "value": 55, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '友联村') {
          this.data1.data = [
            {"name": "牛", "value": 419, "unit": ''},
            {"name": "绵羊", "value": 2328, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 7, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 98, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '准宝日') {
          this.data1.data = [
            {"name": "牛", "value": 643, "unit": ''},
            {"name": "绵羊", "value": 643, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 128, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 156, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } else if (this.villageName == '准哈日毛都嘎查村委员会') {
          this.data1.data = [
            {"name": "牛", "value": 5324, "unit": ''},
            {"name": "绵羊", "value": 7285, "unit": ''},
            {"name": "山羊", "value": 0, "unit": ''},
            {"name": "马", "value": 154, "unit": ''},
            {"name": "驴", "value": 0, "unit": ''},
            {"name": "骡子", "value": 0, "unit": ''},
            {"name": "猪", "value": 0, "unit": ''},
            {"name": "骆驼", "value": 0, "unit": ''},
          ]
          this.data2.data = []
        } 
        

        this.data3 = {
          title: {
            text: "繁殖统计",
            right: "20px",
            top: '0%',
            textStyle: {
              color: "#fff"
            }
          },
          yName: '头、只',
          x: ['牛', '绵羊', '山羊', '马', '驴', '骆驼'],
          y: [18, 39, 12, 3, 3, 2, 3]
        }

        this.data1 = {...this.data1}
        this.data2 = {...this.data2}
      },

      // 获取 嘎查 中的 小组列表
      async getUserList(villageId) {
        let res = await getUserList(villageId)
        try {
          if (res.code == 1000) {
            this.muHuList = res.data
          }
        } catch(err) {
          console.log(err)
        }
      },

      // 获取 动物的 存栏、防疫统计
      async getRecordsYiStatisticByAreaCode(areaCode, level, jobId) {
        let res = await getRecordsYiStatisticByAreaCode(areaCode, level, jobId)
        try {
          if (res.code == 1000) {
            let chart_data = []
            let data = {}
            if(res.data && res.data.length) {
              res.data.map(item => {
                data = { name: item.animalName, value: item.fangYiCount, unit: ' ' }
                chart_data.push(data)
              })

              this.data2 = {
                unit: '头、只、匹',
                isShowUnit: true,
                data: chart_data
              }
            } else {
              this.data2.data = {
                unit: '头、只、匹',
                isShowUnit: true,
                data: []
              }
            }

            this.data2 = {...this.data2}
          }
        } catch (err) {
          console.log(err)
        }
      },

      // 获取牧户列表
      async getMuHuList() {
        let params = { village: "大板镇" }
        let res = await getMuHuList(params)
        
        this.muHuList = res.data.results.sort((a, b) => {
          return b.cattle_num - a.cattle_num
        })
      },

      // 跳转到牧户详情页
      goToMuHuDetail(id) {
        let muHuId = id

        this.$router.push({
          path: "/bigscreen/muHuPage" + muHuId
        })
      },

      // 跳转到 孟和那顺 牧户详情页
      goToMengHeNaShun() {
        this.$router.push({
          path: ""
        })
      },

      // 跳转到 menu 页面
      goToMuHuPage(item) {
        let path = ''
        if (this.villageName == '巴润哈日毛都嘎查村委员会' && item.nickName == '孟和巴特尔') {
          path = '/mengHeNaShunPage'
        } else {
          path = `/bigscreen/muHuPage/${item.id}/${item.nickName}` 
        }
        this.$router.push({
          path
        })
      },

      clickTab(val) {
        if (val == 0) {
          this.list = this.list1
        } else if (val == 1) {
          this.list = this.list2
        } else if (val == 2) {
          this.list = this.list3
        } else if (val == 3) {
          this.list = this.list4
        } else if (val == 4) {
          this.list = this.list5
        } else if (val == 5) {
          this.list = this.list6
        }
      },

      // 跳转到 人口统计 图表详情
      goToPersonStateDetail() {
        let title = `xxx村人口统计`

        this.$router.push({
          path: "/bigscreen/personState" + title
        })
      },

      // 跳转到 机械化统计 图表详情
      goToMashineStateDetail() {
        let title = `xxx村机械化统计`

        this.$router.push({
          path: "/bigscreen/mashineState" + title
        })
      },

      // 格式化手机号 175 **** 4435
      formatPhone(val) {
        val = val.toString()
        return val.substring(0, 3) + '****' + val.substring(7, 12)
      },
    }
  }
</script>

<style scoped lang="less">
  .activeColor { color: #2366fc !important; }

  @media screen and (min-width: 1200px) and (max-width: 1399px) {
    
  }
</style>
